inherited frmRecalculation: TfrmRecalculation
  Left = 457
  Top = 199
  Width = 556
  Height = 519
  Caption = #1055#1077#1088#1077#1088#1072#1089#1095#1077#1090#1099' '#1087#1086' '#1076#1074#1080#1078#1077#1085#1080#1102' '#1075#1088#1072#1078#1076#1072#1085
  Constraints.MinHeight = 400
  Constraints.MinWidth = 500
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited pStatusBar: TStatusBar
    Top = 473
    Width = 548
  end
  inherited ToolBar1: TToolBar
    Width = 548
    Height = 0
    Visible = False
  end
  inherited Panel2: TPanel
    Left = 0
    Top = 0
    Width = 548
    Height = 418
    Align = alClient
    object DBGridEh1: TDBGridEh
      Left = 0
      Top = 78
      Width = 548
      Height = 340
      Align = alClient
      AllowedOperations = [alopDeleteEh, alopAppendEh]
      AllowedSelections = [gstRecordBookmarks, gstRectangle, gstAll]
      DataGrouping.GroupLevels = <>
      DataSource = dscRefer
      Flat = True
      FooterColor = clWindow
      FooterFont.Charset = DEFAULT_CHARSET
      FooterFont.Color = clWindowText
      FooterFont.Height = -11
      FooterFont.Name = 'MS Sans Serif'
      FooterFont.Style = []
      Options = [dgTitles, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect]
      OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghDialogFind, dghColumnResize]
      PopupMenu = PopupMenu
      RowDetailPanel.Color = clBtnFace
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      UseMultiTitle = True
      VTitleMargin = 5
      Columns = <
        item
          EditButtons = <>
          FieldName = 'ABONENT_ID'
          Footers = <>
          Visible = False
        end
        item
          EditButtons = <>
          FieldName = 'ADDRESS'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'BDATE'
          Footers = <>
        end>
      object RowDetailData: TRowDetailPanelControlEh
      end
    end
    object gbUser: TGroupBox
      Left = 0
      Top = 0
      Width = 548
      Height = 78
      Align = alTop
      Caption = ' '#1055#1077#1088#1080#1086#1076' '#1088#1072#1073#1086#1090#1099' '#1087#1072#1089#1087#1086#1088#1090#1080#1089#1090#1072' '
      TabOrder = 1
      object Label2: TLabel
        Left = 8
        Top = 49
        Width = 17
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1089
      end
      object Label3: TLabel
        Left = 160
        Top = 49
        Width = 25
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1087#1086
      end
      object BitBtn1: TBitBtn
        Left = 344
        Top = 44
        Width = 75
        Height = 25
        Action = aSearch
        Caption = #1055#1086#1080#1089#1082
        TabOrder = 3
        Glyph.Data = {
          36040000424D3604000000000000360000002800000010000000100000000100
          2000000000000004000000000000000000000000000000000000FF00FF00FF00
          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF0086743900D9BF4900E6CD5100EDD35300ECD25300DFC5
          4C00C2AA42009D947700FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00AB933A00E8CE4F00EECC4C00ECC54700EBC04200EBC14300EDC9
          4A00F0D25000BDA33800C1B38500FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00AC933A00ECC54600E8B83E00E6B03800E6B03800E6B03800E5B03700E5B0
          3800E8B74600EFCE6B00EAC94A00FF00FF00FF00FF00FF00FF00FF00FF00AC95
          5000E5C04500E7B43B00E5AE3700E4AD3600E5AD3600E5AD3600E4AD3600E6B4
          4600F6E4BB00F5ECD900E9BE4600A3852600FF00FF00FF00FF00FF00FF00D4AC
          3A00E7B53B00E3A83400E3A83400E3A93700E8B75700E4AA3900E5B14700FEFC
          F800F5F1E800D39F3600E4AB3600E8BA4000AA934E00FF00FF00FF00FF00DDAE
          3A00E4AB3600E2A53200E6B35100FDFAF300FCFBF900FBF2E300F8ECD300F3EE
          E400C6A05800E2A53200E2A63200E6B23A00B7984100FF00FF00FF00FF00E0A6
          3600E0A03000EBC78700FDFBFA00C7943C00D1942C00C1985100F9F6F200DAA4
          4700E09F2F00E09F2F00E09F2F00E2A53200C49A3D00FF00FF00FF00FF00E2AF
          5600E3A94900F6E7CD00F1E8DA00DF9F3400DF9F3300DD9C3000D8C19A00E4B2
          5D00DF9D2F00DE9C2E00DF9C2E00DF9E2F00C29B4B00FF00FF00FF00FF00DBB4
          7100E6B05F00F1E1CA00F9F1E400E3AA5300E3A95100E3A74D00ECD4AE00E3B4
          6B00E1A34400E0A04000E0A03E00E4AB5400AD945500FF00FF00FF00FF00C6AB
          7300E9BB7800D7B88B00FCFBF900EABF8000E5B16300ECC48900FCFAF700DDA9
          5D00E2A64E00E1A34900E1A34700DAB16F00B8A36C00FF00FF00FF00FF00FF00
          FF00C1A56B00E8BC7F00CEA97700F4F1EC00FFFFFF00E6DDD000C3A57A00E4AE
          6300E4AC6000E3AA5C00E9BC7E00AF9C6800FF00FF00FF00FF00FF00FF00FF00
          FF00C7B99200EDD1A900EBC39000BB966600B9996F00C49B6500E4B27200E6B2
          6F00E6B36F00ECC59100D2B37D00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF00A88E4E00F1D8B700F1D6B300F1D3AE00F0D2AC00F1D4
          B000E3C69C00B09E6A00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF00FF00FF00AF9B6500C3AA7700CFB68800CDB38400B19A
          6200BEAE8100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00}
      end
      object dbtBdate: TDBDateTimeEditEh
        Left = 32
        Top = 47
        Width = 121
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 1
        Visible = True
      end
      object dbtEdate: TDBDateTimeEditEh
        Left = 192
        Top = 47
        Width = 121
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 2
        Visible = True
      end
      object lcbUsers: TDBLookupComboboxEh
        Left = 32
        Top = 23
        Width = 281
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = ' --- '
        DropDownBox.SpecRow.Value = '-1'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dsc_UserList
        TabOrder = 0
        Visible = True
      end
    end
  end
  object Panel: TPanel [3]
    Left = 0
    Top = 418
    Width = 548
    Height = 55
    Align = alBottom
    BevelOuter = bvNone
    TabOrder = 3
    object Label1: TLabel
      Left = 22
      Top = 9
      Width = 115
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1054#1082#1086#1085#1095#1072#1085#1080#1077' '#1087#1077#1088#1080#1086#1076#1072
    end
    object Label5: TLabel
      Left = 22
      Top = 33
      Width = 115
      Height = 13
      Alignment = taRightJustify
      AutoSize = False
      Caption = #1044#1072#1090#1072' '#1085#1072#1095#1080#1089#1083#1077#1085#1080#1103
    end
    object dbtChargeEdate: TDBDateTimeEditEh
      Left = 144
      Top = 7
      Width = 89
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Flat = True
      Kind = dtkDateEh
      TabOrder = 0
      Visible = True
    end
    object BitBtn2: TBitBtn
      Left = 344
      Top = 26
      Width = 75
      Height = 25
      Action = aCalc
      Caption = #1055#1077#1088#1077#1088#1072#1089#1095#1077#1090
      TabOrder = 2
    end
    object BitBtn3: TBitBtn
      Left = 424
      Top = 26
      Width = 75
      Height = 25
      Action = aExit
      Caption = #1042#1099#1093#1086#1076
      TabOrder = 3
      Glyph.Data = {
        36040000424D3604000000000000360000002800000010000000100000000100
        2000000000000004000000000000000000000000000000000000FF00FF00FF00
        FF00FF00FF00FF00FF00FF00FF00FF00FF002999D5001F98D20052ACDD00FF00
        FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
        FF00FF00FF006BB8E2006BB8E2005AB0DF0031BEE70031E7FF0029D3F70029BE
        E7001FA4DF0052ACDD00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50039CFEF0039CFF70029C3EF0039C7E70000D3F70000CBF70008D7
        FF0018D3F70042E3FF0021A6DE00FF00FF00FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50021CFFF00005C5000005C500039C3E70000D7F70000CFF70010DB
        FF0008CBF70008CBF70042D3EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500039C3E70000D7FF0000D3F70010DB
        FF0008CFF70008CBF70042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500031BEE70008DBFF0000D3F70010DB
        FF0008CFF70008CFF70042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500031BEE7004AC3BD00005C500010DF
        FF0008D3F70008CFF70042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500031BAE70073B69400F7B2630010DF
        FF0008D3FF0008CFF70042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500031BAE70008E3FF0018D3E70010DF
        FF0008D7FF0008D3FF0042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500029BAE70010E7FF0000DFFF0010DF
        FF0008D7FF0008D3FF0042D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500029B6E70010EBFF0000DFFF0010E3
        FF0008DBFF0008D7FF0039D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500029B6E70029DFE700C6C38C00A5CF
        B5007BC7B5004AC3BD0039D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500029B2DE0031DFDE00FFCF9400FFFB
        E700FFFFF700E7CBA50039D7EF007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50018CFFF00005C5000005C500021AEDE0018EFFF0018DBE7004ACB
        BD006BC7B5007BBEA50039D7F7007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF007BC0E50039DFFF0029D3FF0029D3FF00109AD60052E7F70052F7FF0052F7
        FF0052F7FF004AF3FF004ADBF7007BC0E500FF00FF00FF00FF00FF00FF00FF00
        FF00FF00FF0037A3D70037A6DD0037A6DD00319DD700319DD700319DD70031A0
        D70036A6DC002DAAE1000F95D7007BC0E500FF00FF00FF00FF00}
    end
    object dbtDocdate: TDBDateTimeEditEh
      Left = 144
      Top = 31
      Width = 89
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Flat = True
      Kind = dtkDateEh
      TabOrder = 1
      Visible = True
    end
  end
  inherited shblActionList: TActionList
    Left = 200
    Top = 65532
    inherited aExit: TAction
      Caption = #1042#1099#1093#1086#1076
    end
    object aSearch: TAction
      Caption = #1055#1086#1080#1089#1082
      ImageIndex = 21
      OnExecute = aSearchExecute
    end
    object aCalc: TAction
      Caption = #1055#1077#1088#1077#1088#1072#1089#1095#1077#1090
      OnExecute = aCalcExecute
    end
    object aDel: TAction
      Caption = #1059#1076#1072#1083#1080#1090#1100' '#1079#1072#1087#1080#1089#1100
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1074#1099#1076#1077#1083#1077#1085#1085#1091#1102' '#1079#1072#1087#1080#1089#1100' '#1080#1079' '#1089#1087#1080#1089#1082#1072
      OnExecute = aDelExecute
    end
    object aDellAll: TAction
      Caption = #1059#1076#1072#1083#1080#1090#1100' '#1074#1089#1077
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1074#1089#1077' '#1079#1072#1087#1080#1089#1080' '#1080#1079' '#1089#1087#1080#1089#1082#1072
      OnExecute = aDellAllExecute
    end
  end
  inherited dsRefer: TpFIBDataSet
    SelectSQL.Strings = (
      'select distinct'
      '       v.id as abonent_id,'
      '       v.address,'
      '       min(cast(firstdaymonth(maxvalue(ch.docdate,'
      '             (select max(d.bdate) from dogovors d'
      
        '              join rmanag r on r.id = d.manag_id and r.closed_rs' +
        ' = 0'
      
        '              join userorg vs on vs.id = d.supplier_id and vs.cl' +
        'osed_rs = 0'
      '              where d.abonent_id = v.id))) as date)) as bdate'
      '  from clients_stat_hist ch'
      '  join v_abons v on v.id = ch.abonent_id'
      
        '  where (ch.modifydate between :pbdate and :pedate or ch.created' +
        'ate between :pbdate and :pedate)'
      
        '    and (:puser_id = -1 or :puser_id in (ch.createuserid, ch.mod' +
        'ifyuserid))   '
      
        '    and exists (select 1 from vw_dogovors d where d.abonent_id =' +
        ' v.id)'
      '  group by 1,2'
      '  order by v.address')
    BeforeOpen = dsReferBeforeOpen
  end
  inherited dscRefer: TDataSource
    DataSet = mteRefer
  end
  inherited PropStorage: TPropStorageEh
    Left = 160
    Top = 65532
  end
  object mteRefer: TMemTableEh
    Params = <>
    Left = 296
    Top = 200
    object mteReferABONENT_ID: TIntegerField
      FieldName = 'ABONENT_ID'
    end
    object mteReferADDRESS: TStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 50
      FieldName = 'ADDRESS'
      Size = 245
    end
    object mteReferBDATE: TDateField
      DisplayLabel = #1053#1072#1095#1072#1083#1086' '#1087#1077#1088#1080#1086#1076#1072
      DisplayWidth = 16
      FieldName = 'BDATE'
    end
  end
  object PopupMenu: TPopupMenu
    Images = MAIN.ImageList
    Left = 176
    Top = 224
    object N1: TMenuItem
      Action = aDel
    end
    object N2: TMenuItem
      Action = aDellAll
    end
  end
  object ds_UserList: TpFIBDataSet
    SelectSQL.Strings = (
      'select'
      '    u.id,'
      
        '    coalesce(surname||'#39' '#39', '#39#39')||coalesce(firstname||'#39' '#39', '#39#39')||co' +
        'alesce(lastname, '#39#39') as name'
      'from username u'
      
        'where exists (select 1 from clients_stat_hist ch  where u.id in ' +
        '(ch.createuserid, ch.modifyuserid))'
      'order by access desc, name')
    AfterCancel = dsReferAfterRefresh
    AfterEdit = dsReferAfterEdit
    AfterInsert = dsReferAfterInsert
    AfterOpen = dsReferAfterRefresh
    AfterRefresh = dsReferAfterRefresh
    Transaction = trRefer
    Database = MAINDM.pMainDatabase
    AfterFetchRecord = dsReferAfterFetchRecord
    UpdateTransaction = MAINDM.pMainTransaction
    Left = 320
    Top = 16
    oRefreshAfterDelete = True
    oRefreshDeletedRecord = True
  end
  object dsc_UserList: TDataSource
    DataSet = ds_UserList
    Left = 352
    Top = 16
  end
  object qCharge: TpFIBQuery
    Transaction = trCharge
    Database = MAINDM.pMainDatabase
    SQL.Strings = (
      'SELECT 1'
      'FROM'
      '    PROC_GENCHARGE(:PABONENT_ID,'
      '    :PSERVICE_ID,'
      '    :PGROUP_ID,'
      '    :PBDATE,'
      '    :PEDATE,'
      '    :PDOGOVOR_ID,'
      '    1,'
      '    :PDOCDATE) ')
    Left = 296
    Top = 240
    qoStartTransaction = True
  end
  object trCharge: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 328
    Top = 240
  end
end
